package com.yuzhenxin.coursesystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuzhenxin.coursesystem.entity.CourseDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface CourseMapper extends BaseMapper<CourseDO> {

    //根据学分划分课程
    @Select("select credit,count(number) total from course group by credit")
    List<Map<String, Object>> selectCourseGroupByCredit();

}
